﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using MS.InformationManagement.Presenter.ReportesPrestamos;
using System.Collections.Generic;
using MS.InformationManagement.DAL.DocumentCenter;


namespace MS.InformationManagement.Controls._CONTROLTEMPLATES.InformationManagerControls
{
    public partial class ReportesPrestamos : UserControl, IReportesPrestamosView
    {

        #region fields

        ReportesPrestamosPresenter _presenter;

        #endregion

        #region Properties

        public Guid GuidCurrentList
        {
            get { return new Guid(Page.Request.QueryString["lstID"]); }
        }
        public List<SolicitudDePrestamosContentType> ListPrestamos { get; set; }
        public List<SolicitudDePrestamosContentType> ListDevueltos { get; set; }
        public List<SolicitudDePrestamosContentType> ListSolicitudesRechazadas { get; set; }
        public List<SolicitudDePrestamosContentType> ListPrestamosRechazadas { get; set; }

        public string CurrentListId { get; set; }

        #endregion

        #region Form Methods

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            _presenter = new ReportesPrestamosPresenter(this);

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            _presenter.HandleLoad();
        }

        #region Eventos Grillas

        protected void gvPrestamos_RowCreated(object sender, GridViewRowEventArgs e)
        {

        }

        protected void gvPrestamos_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Controls[0].Visible = false;
            }

        }

        protected void gvPrestamos_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {

        }

        protected void gvDevueltos_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {

        }

        protected void gvDevueltos_RowCreated(object sender, GridViewRowEventArgs e)
        {

        }

        protected void gvDevueltos_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Controls[0].Visible = false;
            }

        }

        protected void gvSolicitudesRechazadas_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {

        }

        protected void gvSolicitudesRechazadas_RowCreated(object sender, GridViewRowEventArgs e)
        {

        }

        protected void gvSolicitudesRechazadas_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Controls[0].Visible = false;
            }

        }

        protected void gvPrestamosRechazados_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {

        }

        protected void gvPrestamosRechazados_RowCreated(object sender, GridViewRowEventArgs e)
        {

        }

        protected void gvPrestamosRechazados_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Controls[0].Visible = false;
            }

        }

        #endregion


        #endregion

        #region Implemented Methods

        public void Show()
        {
            gvPrestamos.DataSource = ListPrestamos;
            gvPrestamos.DataBind();

            gvDevueltos.DataSource = ListDevueltos;
            gvDevueltos.DataBind();

            gvSolicitudesRechazadas.DataSource = ListSolicitudesRechazadas;
            gvSolicitudesRechazadas.DataBind();


            gvPrestamosRechazados.DataSource = ListPrestamosRechazadas;
            gvPrestamosRechazados.DataBind();

        }


        #endregion

       
    }
}
